import { createRouter, createWebHistory } from 'vue-router';
let puildPath = window.__MICRO_APP_ENVIRONMENT__?'/app':'/'
let path = window.__MICRO_APP_ENVIRONMENT__?window.__MICRO_APP_BASE_ROUTE__:''
const routes = [
	{
		path: window.__MICRO_APP_BASE_ROUTE__, /**根据项目运行的不同环境，设置路径的前缀 */ 
		name: 'Home',
		// redirect: {
		// 	name: 'FirstHome'
		// },
		component: () => import('@/views/Empty.vue'),
	},
	{	
		path: `${path}/home`,
		name: 'FirstChild',
		children: [
			{
			path: `${path}/home`,
			name: 'FirstHome',
			component: () => import('@/views/Home.vue')
		}, {
			path: `${path}/about`,
			name: 'FirstAbout',
			component: () => import('@/views/About.vue')
		},
		{
			path: `${path}/empty`,
			name: 'FirstEmpty',
			component: () => import('@/views/Empty.vue'),
		}]
	}
]
const router = createRouter({
  history: createWebHistory(puildPath), // 使用 HTML5 历史模式
  routes, // `routes: routes` 的缩写
});
 
export default router;